import request from '@/axios';
import { baseUrl } from '@/config/env';

export const getMenuChild = () => request({
  url: baseUrl + '/app/admin/menu/getChild',
  method: 'get'
});

export const getTreeData = () => request({
  url: baseUrl + '/app/admin/menu/getTreeData',
  method: 'get'
});

export const add = (data) => request({
  url: baseUrl + '/app/admin/menu/insert',
  method: 'post',
  data: data
});

export const update  = (data) => request({
  url: baseUrl + '/app/admin/menu/update',
  method: 'post',
  data: data
});

export const del  = (id) => request({
  url: baseUrl + '/app/admin/menu/delete',
  method: 'post',
  data:{id:id}
});
